<template>
<div class="container">
    <el-form ref="form" :model="form" label-width="80px">

    <el-form-item label="工号" >
        <el-input v-model="form.t_id" :disabled="true"></el-input>
    </el-form-item>

    <el-form-item label="姓名" >
        <el-input v-model="form.t_name" :disabled="true"></el-input>
    </el-form-item>

    <el-form-item label="邮箱">
        <el-input v-model="form.t_email"></el-input>
    </el-form-item>

    <el-form-item label="电话">
        <el-input v-model="form.t_tel"></el-input>
    </el-form-item>

    <el-form-item>
        <el-button type="primary" @click="onSubmit">修改</el-button>
    </el-form-item>
    </el-form>
</div>
</template>


<script>
import { updateInfor } from '@/api/user'
export default {
data() {
    return {
    form: {
        t_id: '',
        t_name: '',
        t_email: '',
        t_tel: ''
    }
    }
},
methods: {
    onSubmit() {
    updateInfor({ 't_id': this.form.t_id, 't_name': this.form.t_name, 't_email': this.form.t_email, 't_tel': this.form.t_tel }).then(response => {
        this.$message({
        message: response.message,
        type: response.data.message
        })
    })
    }
},
created: function() {
    this.form.t_id = this.$store.getters.t_id
    this.form.t_name = this.$store.getters.name
}
}

</script>

<style lang="scss" scoped>
.container{
    width: 50%;
    margin: auto;
    margin-top:10px
}
</style>
  